package com.sinacom.ibuilding.dao.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.ibatis.dao.client.DaoManager;
import com.ibatis.dao.client.template.SqlMapDaoTemplate;
import com.sinacom.ibuilding.beans.Schedule;
import com.sinacom.ibuilding.dao.iface.ScheduleDao;

public class ScheduleDaoImpl extends SqlMapDaoTemplate implements ScheduleDao{
	
	public ScheduleDaoImpl(DaoManager daoManager){
		super(daoManager);
	}
	
	public List getScheduleList(Map map) {
	    return queryForList("getScheduleList", map);
    }
	
	public int getScheduleListCount(Map map) {
    	Object obj = queryForObject("getScheduleListCount", map);
		return obj==null?0:((Integer)obj).intValue();
	}
    
    public void insertSchedule(Schedule schedule) {
    	Date now = new Date();
    	schedule.setCreateDate(now);
    	schedule.setModifyDate(now);
        insert("insertSchedule", schedule);
    }

	public void updateSchedule(Schedule schedule) {
        update("updateSchedule", schedule);
    }

    public List getScheduleDay(Map map) {
        return queryForList("getScheduleDay", map);
    }

    public void deleteSchedule(Map map) {
        update("deleteSchedule", map);
    }
    
   

}
